<template>
	<view>
		<swiper :autoplay="true" :interval="3000" :duration="1000" :circular="true">
			<swiper-item v-for="item in list" :key="item.id">
				<image @click="clickBanner(item)" class="swiper-item" :src="item.src" mode="aspectFit"></image>
			</swiper-item>
		</swiper>
	</view>
</template>

<script>
export default {
	name: 'indexSwiper',
	props: {
		list: {
			type: Array,
			required: true
		}
	},
	methods: {
		clickBanner(item) {
			uni.$u.toast(`点击了id${item.id}的banner`);
		}
	}
};
</script>

<style lang="scss" scoped>
.swiper-item {
	width: 690rpx;
	height: 300rpx;
	margin: 0 auto;
}
</style>
